﻿using System;
using System.Collections.Generic;
using System.Xml.Serialization;

namespace LdtJudge.DataEngine.Model.XMLConfigModel.EvidenceStandardizationModel
{
    /// <summary>
    /// 证据标准化信息回填案件要素的配置模型
    /// </summary>
    [Serializable]
    [XmlRootAttribute("root", IsNullable = false)]
    public class EvidenceFillCaseElementConfigModel
    {
        /// <summary>
        /// 证据名称
        /// </summary>
        [XmlAttribute("cd_name")]
        public string Cd_Name { get; set; }
        /// <summary>
        /// 证据编号
        /// </summary>
        [XmlAttribute("cd_code")]
        public string Cd_Code { get; set; }
        /// <summary>
        /// 配置组列表
        /// </summary>
        [XmlElementAttribute("elementgroup", IsNullable = false)]
        public List<ElementGroup> ElementGroups { get; set; }
    }

    /// <summary>
    /// 配置组信息
    /// </summary>
    public class ElementGroup
    {
        /// <summary>
        /// 证据名称
        /// </summary>
        [XmlAttribute("id")]
        public string Id { get; set; }

        [XmlElementAttribute("xmlLabel", IsNullable = false)]
        public List<XmlLabel> XmlLabels { get; set; }
    }

    public class XmlLabel
    {
        ///<summary>
        /// 数据源Xmlpath
        ///</summary> 
        [XmlAttribute("sourcexpath")]
        public string Sourcexpath { get; set; }
        ///<summary>
        /// 目标Xmlpath
        ///</summary> 
        [XmlAttribute("targetxpath")]
        public string Targetxpath { get; set; }
        /// <summary>
        /// 子级属性集合
        /// </summary>
        [XmlElementAttribute("element", IsNullable = false)]
        public List<Element> Elements { get; set; }
    }

    /// <summary>
    /// 属性配置集合
    /// </summary>
    public class Element
    {
        ///<summary>
        /// 数据源属性名
        ///</summary> 
        [XmlAttribute("sourcename")]
        public string Sourcename { get; set; }
        ///<summary>
        /// 目标源属性名
        ///</summary> 
        [XmlAttribute("targetname")]
        public string Targetname { get; set; }
        ///<summary>
        /// 是否比对0否，1是
        ///</summary> 
        [XmlAttribute("type")]
        public int Type { get; set; }
        ///<summary>
        /// 如果对比，顺序
        ///</summary> 
        [XmlAttribute("order")]
        public int Order { get; set; }
        ///<summary>
        /// 标识
        ///</summary> 
        [XmlAttribute("subject")]
        public int Subject { get; set; }
    }

}
